﻿using Anke.SHManage.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Anke.SHManage.Web.Areas.CM.Controllers
{
    public class MaintainRemindController : Controller
    {
        //
        // GET: /CM/MaintainRemind/

        public ActionResult MaintainRemindList()
        {
            return View();
        }
        //获取保养列表
        [HttpPost]
        public ActionResult getAllambMaintain()
        {
            DateTime beginTime = Convert.ToDateTime(Request.Form["beginTime"]);
            DateTime endTime = Convert.ToDateTime(Request.Form["endTime"]);
            string DayKM = Convert.ToString(Request.Form["DayKM"]);

            int totals = 0;
            var list = new C_AmbulanceBLL().getAllambMaintain(ref totals, beginTime,  endTime, DayKM);

            if (totals > 0)
            {
                return Json(new { total = totals, rows = list }, "appliction/json", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json(new { total = 0, rows = "" }, "appliction/json", JsonRequestBehavior.AllowGet);
            }
         

        }
        

    }
}
